//射频回调的数据用
class ReaderEvent {
  String? type; //消息类型
  int? gpiName; //端口号
  String? level; //高低位
  List<String>? epcList; //返回的读取到的epc号码

  ReaderEvent({
    this.type,
    this.gpiName,
    this.level,
    this.epcList,
  });

  ReaderEvent.fromJson(Map<String, dynamic> json) {
    gpiName = json['gpiName']?.toInt()??0;
    level = json['level'];
    type = json['type'];
    epcList = json['epcList'].cast<String>();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['gpiName'] = gpiName;
    data['level'] = level;
    data['type'] = type;
    data['epcList'] = epcList;
    return data;
  }

  @override
  String toString() {
    return 'ReaderEvent(type: $type, gpiName: $gpiName, level: $level, epcList: $epcList)';
  }
}
